public class nihao {
    /* 第一个Java程序
     * 它将打印字符串 Hello World
     */
    public static void main(String[] args) {
    	
    	Scanner scan = new Scanner(System.in);
    	String str = scan.nextLine();
    	String[] array1 = str.split(" ");
    	
    	
    	for(int i = array1.length-1;i>=0;i--) {
    		System.out.println(array1[i]);
    	}
    	
    
        
    }
}